<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/api/mapres/save}">
        <input type="hidden" name="id" th:if="${mapres}" th:value="${mapres.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="title" placeholder="请输入标题" th:value="${mapres?.title}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">服务地址</label>
            <div class="layui-input-inline">
                <input class="layui-input" id="J_layer_url" type="text" name="url" placeholder="请输入服务地址" th:value="${mapres?.url}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图层ID</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="layerId" placeholder="请输入图层ID" th:value="${mapres?.layerId}">
            </div>
            <div class="layui-input-inline">
                <button class="layui-btn open-popup-settingLayerid" data-title="设置ID" data-size="auto"  th:attr="data-url=@{'/api/mapres/settinglayerid/'}" >
                    <i class="fa fa-plus"></i>设置</button>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">显示字段</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="showFields" placeholder="请输入显示字段" th:value="${mapres?.showFields}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">查询字段</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="searchFields" placeholder="请输入查询字段" th:value="${mapres?.searchFields}">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${mapres?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
    <script th:src="@{/static/js/plugins/jquery-3.3.1.min.js}"></script>
    <script th:src="@{/static/js/mapres/add.js}"></script>
</body>
</html>